package com.example.hyw.szysteam.view;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import com.example.hyw.szysteam.R;
import com.qmuiteam.qmui.widget.QMUITopBar;

import android.view.ViewGroup;
import android.widget.ImageView;

/**
 * Created by HYW on 2018/5/22.
 */

public class HomePagerFragmrnt extends Fragment {
    private View view;
    private QMUITopBar mTopBar;
    private ImageView practice;
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view=inflater.inflate(R.layout.fragment_homepager,container,false);
        initTopBar();
        initView();
        return view;
    }
    private void initTopBar(){
        mTopBar=view.findViewById(R.id.home_topbar);
        mTopBar.setTitle("首页").setTextColor(getResources().getColor(R.color.myWhite));
    }

    private void initView(){
        practice=view.findViewById(R.id.practice);
        practice.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(getActivity(),PracticeOptionActivity.class);
                startActivity(intent);
            }
        });
    }
}
